package Utils;
/**
 * @author Shir Peleg
 * this calss represent A pair of general types
 * @param <T1>
 * @param <T2>
 */

public class Pair<T1, T2>
{
	private T1 t1;
	private T2 t2;

	public Pair(T1 t1, T2 t2)
	{
		this.t1 = t1;
		this.t2 = t2;
	}
	public T1 getT1() {
		return t1;
	}
	public T2 getT2() {
		return t2;
	}
	public boolean equals(Object other) {
		if (other==this)
			return true;
		if (other==null)
			return false;
		if (other instanceof Pair)
		{
			@SuppressWarnings("unchecked")
			Pair<T1,T2>obj=(Pair<T1,T2>)other;
			System.out.println(obj.toString());
			return (this.t1.equals(obj.t1) && this.t2.equals(obj.t2));
		}
		return false;
	}
	public String toString()
	{
		return "("+t1.toString()+","+t2.toString()+")";
	}
	
}